/*
 * Rectangle2D.h
 *
 *  Created on: 31.1.2013
 *      Author: Travis
 *
 *      This structure is store 4 points of rectangle in 2D space
 *		A - bottomleft
 *		B - topleft
 *		C - topright
 *		D - bottomright
 */

#pragma once

#ifdef _WIN32 
#include <windows.h> 
#endif

#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <cmath>
#include <iostream>
#include "../console/globalConsole.h"

#define PI 3.14159265

namespace DataTypes
{

class Rectangle2D
{
public:
	Rectangle2D(glm::vec2 a, glm::vec2 b, glm::vec2 c, glm::vec2 d);
	Rectangle2D();
	virtual ~Rectangle2D();

	// check collision rectangle - point in 2D
	// Point X vec2 type
	// return TRUE when collision is detected
	bool pointInRectangle2D(glm::vec2 X);

	// check collision rectangle - point in 2D
	// Point X vec2 type
	// return TRUE when collision is detected
	// pos - position of rectangle
	bool pointInRectangle2D(glm::vec2 X, glm::vec2 pos);

	// check collision rectangle - point in 2D
	// rectangle coud be rotated and translated to custom position
	// angle - angle of rotation
	// pos - position of rectangle
	// x - point
	// return TRUE when collision is detected
	bool pointInRectangle2D(float angle, glm::vec2 pos, glm::vec2 X);

	bool RectangleInRectangle2(Rectangle2D rec);

	//get
	glm::vec2 getA();
	glm::vec2 getB();
	glm::vec2 getC();
	glm::vec2 getD();

	//set
	void setA(glm::vec2 a);
	void setB(glm::vec2 b);
	void setC(glm::vec2 c);
	void setD(glm::vec2 d);

private:
	glm::vec2 A, B, C, D;

};
}
